package Count

import org.apache.spark.sql.SparkSession

object UV {
  def main(args: Array[String]): Unit = {
    val spark = SparkSession
      .builder()
      .appName(s"${this.getClass.getName}")
      .master("local[*]")
      .getOrCreate()
    //val sc = spark.sparkContext
    val dataFrame = spark.read.json("D:\\asa\\dianshang\\pay - 副本.log")
    val res = dataFrame.rdd.map(row => {
      val openid = row.getAs[String]("openid")
      openid
    }).distinct().count()
    println(res)
    //9
    spark.stop()
  }
}
